# 启动 Java 应用并获取进程对象
$process = Start-Process "java" -ArgumentList "-jar `"$PSScriptRoot\ruoyi-admin\target\ruoyi-admin.jar`"" -NoNewWindow -PassThru
# 将进程 ID 写入文件
$process.Id | Out-File -FilePath "$PSScriptRoot\application.pid"